/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基本布局 */
body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    color: #2c3e50;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.2em;
}

/* 章节样式 */
.demo-section {
    margin-bottom: 40px;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 4px;
}

h2 {
    color: #34495e;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

/* 1. 字体系列示例 */
.font-examples p {
    margin-bottom: 15px;
    font-size: 18px;
}

.serif {
    font-family: 'Times New Roman', Times, serif;
}

.sans-serif {
    font-family: Arial, Helvetica, sans-serif;
}

.monospace {
    font-family: 'Courier New', Courier, monospace;
}

.custom-font {
    font-family: 'Roboto', sans-serif;
}

/* 2. 字体大小和粗细 */
.text-small { font-size: 14px; }
.text-normal { font-size: 16px; }
.text-large { font-size: 20px; }

.weight-light { font-weight: 300; }
.weight-normal { font-weight: 400; }
.weight-bold { font-weight: 700; }

/* 3. 文本对齐和缩进 */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }
.text-indent { text-indent: 2em; }

.alignment-examples p {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

/* 4. 行高和间距 */
.line-height-small { line-height: 1.2; }
.line-height-normal { line-height: 1.6; }
.line-height-large { line-height: 2; }

.letter-spaced { letter-spacing: 2px; }
.word-spaced { word-spacing: 10px; }

.spacing-examples p {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

/* 5. 文本装饰和效果 */
.underline { text-decoration: underline; }
.line-through { text-decoration: line-through; }

.text-shadow-simple {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    font-size: 20px;
}

.text-shadow-multiple {
    text-shadow: 
        1px 1px 2px #000,
        0 0 1em #0066cc,
        0 0 0.2em #0066cc;
    color: white;
    font-size: 20px;
}

.truncate-example {
    width: 300px;
    margin-bottom: 15px;
}

.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.multiline-truncate-example {
    width: 300px;
}

.text-multiline-truncate {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.decoration-examples p {
    margin-bottom: 15px;
    padding: 10px;
}

/* 6. 书写模式 */
.writing-mode-examples {
    display: flex;
    justify-content: space-around;
    height: 200px;
}

.vertical-text-rl {
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.vertical-text-lr {
    writing-mode: vertical-lr;
    text-orientation: mixed;
}

/* 响应式调整 */
@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 2em;
    }

    .demo-section {
        padding: 15px;
    }

    .truncate-example,
    .multiline-truncate-example {
        width: 100%;
    }
}
